package com.example.studentstatusmanagement.mapper;

import com.example.studentstatusmanagement.pojo.SysUser;
import com.example.studentstatusmanagement.pojo.SysUserExample;
import java.util.List;

import com.example.studentstatusmanagement.pojo.doo.ReqStudent;
import com.example.studentstatusmanagement.pojo.dto.Student;
import com.example.studentstatusmanagement.pojo.dto.StudentInfo;
import com.example.studentstatusmanagement.pojo.dto.StudentInfoUpdate;
import com.example.studentstatusmanagement.pojo.dto.WelcomeNum;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface SysUserMapper {
    int countByExample(SysUserExample example);

    int deleteByExample(SysUserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    List<SysUser> selectByExample(SysUserExample example);

    SysUser selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") SysUser record, @Param("example") SysUserExample example);

    int updateByExample(@Param("record") SysUser record, @Param("example") SysUserExample example);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);

    SysUser selectUserPasswordByName(String loginNumber);

    List<Student> selectStudentInfo(ReqStudent reqStudent);

    StudentInfo selectStudentInfoById(Integer id);

    StudentInfoUpdate selectStudentInfoUpdateById(Integer id);

    // 首页num
    @Select("select (SELECT COUNT(u.id) FROM sys_user u where u.user_isdel =0 and u.user_roleid =2) as stunum,(SELECT COUNT(d.id) FROM dorm d where d.isdel =0) as dormnum,(SELECT COUNT(p.id) FROM plot p where p.isdel = 0 ) as plotnum ,(SELECT count(m.id) FROM major m where m.isdel =0) as majornum,(SELECT count(c.id) FROM classroom c where c.is_del=0) as classnum FROM flag")
    WelcomeNum selectWelcomeNum();

}